#!/usr/bin/python
__author__ = 'Andrew Hopkinson'

import ConfigParser
from server import indexServer, Indexer
import Pyro4
import logging


class GenericIndexer(Indexer):
    def __init__(self):
        self.count = 0
        self.logger = logging


def main():
    config = ConfigParser.SafeConfigParser({'pyro-port': 6500})
    config.read('server.cfg')
    port = int(config.get('anybackup', 'pyro-port'))
    i = indexServer(GenericIndexer())
    Pyro4.Daemon.serveSimple(
        {
            i: "anybackup.indexserver"
        },
        ns=False, port=port, host='')

if __name__ == "__main__":
    main()
